<%--
 *  File:  zylGroupSuitPopWindow.jsp
 *  Date		  Author		  Changes
 *  2012-9-19	  zahirzhong		  Created
 *
 *  Copyright (C) 2000 - 2005 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%
	//init param
  	String privilegeCode = "All";
    String strModuleName = "COM";
  	String contextPath = request.getContextPath();
  	
  	
%>
<%@ include file="/inc/CommonHeader.inc" %>
<iframe name="reloadHandler" style="display:none"></iframe>
<html>
<head>
<title>GroupSuitPopWindow</title>
<PageFlow:CheckPageFlow pageName="p_zylgroupsuit"/>
<%@ include file="/inc/AlertError.inc" %>
<%
  Vector details = (Vector)pageContext.getAttribute("details");
  if(details == null) details = new Vector();
   
  Integer productgroupid = (Integer)pageContext.getAttribute("productgroupid");
  if(productgroupid == null) 
	  productgroupid = new Integer(0);


%>

<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<%
	HashMap Cuserinfo = (HashMap)session.getAttribute("userinfo");
   	if (Cuserinfo==null){
   		Cuserinfo = new HashMap();
   	}
   	String isview=(String)pageContext.getAttribute("isview");
   	
%>
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript">

function page_add(){
    
    if(!checkForm(document.cform))
  		return; 
   
    cform.actionname.value = "add";
    cform.target = "_self";
    isRunning = true;
    cform.submit();
}
function page_delete()
{
    if(isNullChecked(cform.deleteids))
    {
        alert('<%= message.getMessageDesc("MUST_SELECT_ONE_RECORD_TO_DEL") %>');
        return;
    }
    if(!confirm('<%= message.getMessageDesc("ARE_YOU_SURE_DEL") %>')) return;
    cform.actionname.value = "delete";
    cform.target = "_self";
    isRunning = true;
    cform.submit();
}


</script>
<body style="overflow: auto;">
<form name="cform" method="post" action="<%=contextPath%>/Dispatcher" >
  <input type="hidden" name="pagename" value="p_zylgroupsuit">
  <input type="hidden" name="actionname">
  <input type="hidden" name="schema" value="v_zylgroupsuit">
    <input type="hidden" name="productgroupid" value="<%=productgroupid%>">	
  <input type="hidden" name="userid" value="<%=Cuserinfo.get("userid")%>">	
  <input type="hidden" name="numrows" value="<%= details.size() %>">
  <input type="hidden" name="isview" value="<%=isview%>">
<table width="100%" cellspacing="0" border="0" cellpadding="0">
	<tr>
		<td>
		<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0">
		<tr class="deepblue-left"> 
          	<td width="5%" class="deepblue-left">&nbsp;</td>
	  		<td class="title_center">&nbsp;<%= label.getLabelName("L_SuitableUsers") %></td>
        </tr>
	    <span id="olddetail" >
       	<logic:iterate id="suitableusers" collection="<%= details %>" indexId="idx">
       	<tr>
         	<td width="30">
				<custom:checkbox property="productgroupobjid" name="suitableusers" changedName="deleteids" styleClass="normalradio" />
         	</td>
	        <td><custom:write name="suitableusers" property="valuename" nbsp="true" /></td>
    	</tr>
        </logic:iterate>
		</span>
	    <%
		if(!("1".equals(isview))){
		%>
		<span id="newdetail" >
       	<tr >
         	<td>&nbsp;</td>
         	<td>
         	<custom:selectdic dictType="ZylDataCategory" property="datacategory"  valueCriteria="4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,23,24,25" command="notnull" label="L_SuitableUsers" defaultValue="------" defaultValueCost=" " />
            </td>
       	</tr>
		</span>
          
		</table>
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td class="summary_top"></td>
			</tr>
			<tr>
				<td class="td_center"><a onclick="javascript:page_add();"><custom:button type="1" label="L_Add" imgsrc="finish.gif" border="0" style="width:60" /></a>
				<a onclick="javascript:page_delete();"><custom:button type="1" label="L_Delete" imgsrc="finish.gif" border="0" style="width:60" /></a>
			 <a onclick="parent.window.close();"><custom:button type="1" label="L_Close" imgsrc="close.gif" border="0" style="width:60"/></a></td>
			</tr>
		</table>
		<%} else {%>
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td class="summary_top"></td>
			</tr>
			<tr>
				<td class="td_center"><a onclick="parent.window.close();"><custom:button type="1" label="L_Close" imgsrc="close.gif" border="0" style="width:60"/></a></td>
			</tr>
		</table>
		 
		<% }%>
		</td>
	</tr>
</table>

</form>
</body>
</html>